﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessLayer;
using Entities;
using System.Data;

namespace BusinessLogicLayer
{
    public class ThamSoBO
    {
        private ThamSoDAL dal;
        public ThamSoBO()
        {
            dal = new ThamSoDAL();
        }

        public ThamSo layThongTinThamSo()
        {
            ThamSo TS = new ThamSo();
            DataTable table = new DataTable();
            table = dal.layThongTinThamSo();
            if (table.Rows.Count > 0)
            {
                foreach (DataRow row in table.Rows)
                {
                    TS.SoLuongNhapToiThieu = (int)row["TS_SoLuongNhapToiThieu"];
                    TS.SoLuongTonToiDa = (int)row["TS_SoLuongTonToiDa"];
                    TS.TienNoToiDa = (float)(double)row["TS_TienNoToiDa"];
                    TS.TonToiThieuSauKhiBan = (int)row["TS_TonToiThieuSauKhiBan"];
                    TS.ApDungQuiDinh3 = (int)row["TS_ApDungQuyDinh3"];
                }
            }
            return TS;
        }
    }
}
